import request from '@/utils/request'

// 查询工资编报
export function queryUnitSalaryReportPage(query) {
  return request({
    url: '/agencySalaryMultipleController/queryUnitSalaryReportPage',
    method: 'get',
    params: query
  })
}

export function generateFormula(agencyId) {
  return request({
    url: '/agencySalaryMultipleController/generateFormula',
    method: 'get',
    params: {
      agencyId
    }
  })
}

export function queryReallySendSalarySumAndPersonTotal(agencyId, isThirteen) {
  return request({
    url: '/agencySalaryMultipleController/queryReallySendSalarySumAndPersonTotal',
    method: 'get',
    params: {
      agencyId,
      isThirteen
    }
  })
}

export function querySubmitReallySendSalarySumAndPersonTotal(agencyId, isThirteen) {
  return request({
    url: '/agencySalaryMultipleController/querySubmitReallySendSalarySumAndPersonTotal',
    method: 'get',
    params: {
      agencyId,
      isThirteen
    }
  })
}

export function queryReallySendSalarySumTotal(params) {
  return request({
    url: '/agencySalaryMultipleController/queryReallySendSalarySumAndPersonTotal',
    method: 'get',
    params
  })
}

export function queryColumnName(params) {
  return request({
    url: '/agencySalaryMultipleController/queryColumnName',
    method: 'get',
    params
  })
}

export function querySalaryNameDict(params) {
  return request({
    url: '/agencySalaryMultipleController/querySalaryName',
    method: 'get',
    params
  })
}

export function submitData(data) {
  return request({
    url: '/agencySalaryMultipleController/submitUnitSalaryReportData',
    method: 'post',
    data: data
  })
}

export function submit(data) {
  return request({
    url: '/agencySalaryMultipleController/submitUnitSalaryReport',
    method: 'post',
    data
  })
}

export function submitOne(data) {
  return request({
    url: '/agencySalaryMultipleController/submitUnitSalaryReportOne',
    method: 'post',
    data
  })
}

export function rejectSubmit(data) {
  return request({
    url: '/agencySalaryMultipleController/rejectSubmitUnitSalaryReport',
    method: 'post',
    data
  })
}


export function rejectSubmitOne(data) {
  return request({
    url: '/agencySalaryMultipleController/rejectSubmitUnitSalaryReportOne',
    method: 'post',
    data
  })
}

export function rejectEdit(data) {
  return request({
    url: '/agencySalaryMultipleController/rejectEditUnitSalaryReport',
    method: 'post',
    data: data
  })
}

// 区划导出
export function outPutProvinceReportList(query) {
  return request({
    url: '/provinceController/outPutProvinceReportList',
    method: 'get',
    responseType: 'blob',
    params: query
  })
}

// 区划初始化导入
export function provinceImport(data) {
  const config = {
    'Content-Type': 'mutipart/form-data;boundary=' + new Date().getTime()
  }
  return request({
    url: '/provinceController/provinceImportSalaryReportList',
    type: 'upload',
    method: 'post',
    data,
    config
  })
}

// 导出
export function outPutSalaryReportList(query) {
  return request({
    url: '/outPutSalaryReportList',
    method: 'get',
    responseType: 'blob',
    params: query
  })
}
// 导出
export function outPutSalaryReportListDouble(query) {
  return request({
    url: '/outPutSalaryReportListDouble',
    method: 'get',
    responseType: 'blob',
    params: query
  })
}
// 导入
export function Import(data) {
  const config = {
    'Content-Type': 'mutipart/form-data;boundary=' + new Date().getTime()
  }
  return request({
    url: '/ImportSalaryReportList',
    type: 'upload',
    method: 'post',
    data,
    config
  })
}
export function ImportDouble(data) {
  const config = {
    'Content-Type': 'mutipart/form-data;boundary=' + new Date().getTime()
  }
  return request({
    url: '/ImportSalaryReportListDouble',
    type: 'upload',
    method: 'post',
    data,
    config
  })
}

export function verfityExistNoFilePerson(agencyId) {
  return request({
    url: '/agencySalaryMultipleController/verfityExistNoFilePerson',
    method: 'get',
    params: {
      agencyId
    }
  })
}


//对比银行信息
export function JudgePersonBank(agencyId) {
  return request({
    url: '/agencySalaryMultipleController/JudgePersonBank',
    method: 'get',
    params: {
      agencyId
    }
  })
}
// 批次按钮方法
export function addBatch(agencyId) {
  return request({
    url: '/agencySalaryMultipleController/addBatch/' + agencyId,
    method: 'post'
  })
}

export function rejectReturned(agencyId) {
  return request({
    url: '/agencySalaryController/rejectReturnedUnitAudit/' + agencyId,
    method: 'post'
  })
}
  
export function getIsThirteen(agencyId) {
  return request({
    url: '/agencySalaryMultipleController/getIsThirteen',
    method: 'get',
    params: {
      agencyId
    }
  })
}
// 根据单位id获取审核信息
export function getAgencyVerifyByAgencyId(agencyId) {
  return request({
    url: '/agencySalaryMultipleController/getAgencyVerifyByAgencyId/' + agencyId,
    method: 'get'
  })
}

export function queryAgencyNameAndState(agencyId) {
  return request({
    url: '/agencySalaryMultipleController/queryAgencyNameAndState',
    method: 'get',
    params: {
      agencyId
    }
  })
}

// 根据单位id获取bizkey
export function getAgencyVerifyBizKey(agencyId) {
  return request({
    url: '/agencySalaryMultipleController/getAgencyVerifyBizKey/' + agencyId,
    method: 'get'
  })
}
// 根据单位id获取实发工资<=0的人数
export function getPaidWagesCount(agencyId) {
  return request({
    url: '/agencySalaryMultipleController/getPaidWagesCount',
    method: 'get',
    params: {
      'agencyId': agencyId
    }
  })
}

